<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="layout :: htmlhead" th:with="title='生成代码'"></head>
<script type="text/javascript" src="/js/Sortable.js"></script>
<body class="layui-layout-body" style="min-height: 100vh">
<style>
    thead {
        position: sticky;
        top: 0; /* 或者根据需要调整 */
        background-color: white; /* 确保背景色与表格内容区分开 */
        z-index: 1; /* 确保表头在其他内容之上 */
    }
    td {
        margin: 1px;
        padding: 5px;
    }
    *{margin: 0;padding: 0}

    .wrap{
        width:99%;
        height: calc(100vh - 200px);
        border: 1px solid #1e9fff;
        margin: 10px auto;
        position: relative;
    }
    .tableDiv{
        width:100%;
        overflow-y:auto;
        height:calc(100vh - 202px);
    }
    .main{
        height: 100vh;
    }
    .mainBody {
        width: 100%;
        height: 100%;
        background-color: #F2F2F2;
        padding: 2% 0 0 0 ;
    }
    .mainContent{
        margin: 0 5% 0 5%;
        background-color: #FfFfFf;
    }

    .nav{
        width: 100%;
        height: 30px;
    }
    .nav a{
        width: 250px;
        height: 45px;
        text-align: center;
        font-size: 22px;
        line-height: 51px;
        border-right: 1px solid #1e9fff;
        border-bottom: 1px solid #1e9fff;
        float: left;
        text-decoration: none;
        color:black;
    }
    .sh{
        width: 100%;
        position: absolute;
        left: 0;
    }
    .layer_self_wrap td{
        height: 28px;
    }
    .layer_self_wrap input{
        height: 24px;
        width:98% !important;
    }
    .layer_self_wrap select{
        height: 28px;
    }
    .myTitle{
        font-size:16px;
        font-weight: bold;
        padding: 10px;
    }
    .myTitle input{
        vertical-align: middle;
        height: 32px;
        width: 99.3%;
    }
    .myTitle select{
        height: 32px;
        width:100%;
    }
    .myTitle .tdTitle{
        width: 8%;
        text-align: right;
        padding: 5px 0px 5px 5px !important;
    }
    .myBtn{
        height: 32px !important;
        line-height: 32px !important;
        width:160px !important;
    }
    /*遮罩层*/
    .loading{
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        background: #e5e5e5;
        opacity: 0.3;
    }
    /*图标*/
    .loadIcon{
        font-size: 35px;
        color: #000;
        position: relative;
        left: 45%;
        top: 45%;
    }
</style>
<div class="layui-layout layui-layout-admin main">
    <!--头-->
    <div th:replace="fragments/head :: header"></div>
    <div class="mainBody">
    <div class="mainContent">
        <input type="hidden" id="selectId" name="selectId" th:value="${selectId}">
        <input type="hidden" id="selectTableNow" name="selectTableNow" th:value="${selectTableNow}">

        <div class="myTitle" >
            <table style="text-align:center;width:100%;">
                <tr>
                    <td class="tdTitle">
                        存储表名：
                    </td>
                    <td>
                        <input type="text"  th:value="${selectTableNow}" id="selectTableNowValue" disabled="disabled"  >
                    </td>
                    <td  class="tdTitle">
                        功能名称：
                    </td>
                    <td>
                        <input type="text" id="selectProjectName" name="selectProjectName" value="功能"  >
                    </td>
                    <td style="text-align:center;width:180px;">
                        <button class="layui-btn layui-btn-warm myBtn"   onclick="codeAssemblyFun.downloadCode()" >生成并下载</button>
                    </td>
                </tr>
                <tr>
                    <td  class="tdTitle">
                        代码路径：
                    </td>
                    <td>
                        <input type="text" id="selectTableBaseDir" name="selectTableBaseDir"      >
                    </td>
                    <td  class="tdTitle">
                        功能类型：
                    </td>
                    <td>
                        <select id="selectMode" name="selectMode">
                            <option value="qp">启璞</option>
                            <option value="sql">sql</option>
                        </select>
                    </td>
                    <td style="text-align:center;width:180px;">
                        <button class="layui-btn layui-btn-normal myBtn"    onclick="codeAssemblyFun.create()" >生&nbsp;&nbsp;&nbsp;&nbsp;成</button>
                    </td>
                </tr>
            </table>
        </div>
        <div class="wrap">
            <div class="sh">
                <div class="layer_self_wrap" style="width:100%;">
                    <div id="defDiv" class="layer_self_wrap tableDiv"></div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <!--底部-->
    <div th:replace="fragments/footer :: footer"></div>
    <script src="/js/system/codeAssembly.js"></script>

    <div class="loading">
        <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop loadIcon"></i>
    </div>
</div>
</body>
</html>